<?php
/**
 * Created by PhpStorm.
 * User: sunzexin
 * Date: 2018/3/19
 * Time: 09:50
 */

namespace App\Http\Traits;


use Illuminate\Http\Request;

trait CartTrait
{
    use BaseTrait;
    // 验证秘钥
    protected $loginSession;
    // 商品ID
    protected $goods_id;
    // 用户ID
    protected $user_id;
    // 商品数量
    protected $num;
    // 购物车ID
    protected $cart_id;
    // 购物车列表字符串
    protected $cart_list_str;

    public function __construct(Request $request)
    {
        $this->loginSession = $request->input('loginSession', '');
        $this->goods_id = $request->input('goods_id', 0);
        $this->user_id = $request->input('user_id', 0);
        $this->num = $request->input('num', 0);
        $this->cart_id = $request->input('cart_id', 0);
        $this->cart_list_str = $request->input('cart_list_str', '');
    }
}